#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int n = 0;
	scanf("%d",&n);
	int i = 0;
	int j = 1;
	int sum = 0;
	for (i = 1;i <= 5;i++)
	{
		sum = sum + n * j;
		j =j*10+1;
	}
	printf("%d",sum);
	return 0;
}
